package oop.类和方法和构造器;

/**
 * @ClassName : World
 * @Author : LV88VL
 * @Date: 2021/2/4 12:39
 * @Description : 构造器、封装、继承
 */
public class World {
    public static void main(String[] args) {
        //Person类的使用
        Person king = new AfterPerson();
        Person king01 = new AfterPerson01();
        king.setAge(50);
        int age= king.getAge();
        king.setName("黄连口服液");
        String name= king.getName();
        king.setSex("男");
        String sex=king.getSex();
        king.extand();
        king01.extand();
        System.out.println("王的年龄是"+"\t"+age+"\t"+"王的姓名是"+"\t"+name+"\t"+"王的性别是"+"\t"+sex);
        //AfterPerson的使用
        AfterPerson kingson = new AfterPerson();
        kingson.extand();
        String a="kingsonson";
        kingson.test(a);
        ((AfterPerson)king).unextand();
    }

}
